package com.dy.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * @ClassName:
 * @Author: 仄言in
 * @Desctiption: (描述)
 * @Date: 2021/8/1 18:39
 * @Version 1.0 (版本)
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@TableName("dy_blog_tag")
public class DyBlogTagEntity implements Serializable {
    /**
     * id
     */
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;
    /**
     * 博客code
     */
    @TableField(value = "blog_code")
    private String blogCode;
    /**
     * 标签code
     */
    @TableField(value = "tag_code")
    private String tagCode;
    /**
     * 删除标记
     */
    @TableField(value = "deleted",fill = FieldFill.INSERT)
    @TableLogic(value = "0",delval = "1")
    private Integer deleted;
    /**
     * 乐观锁
     */
    @TableField(value = "rowVersion",fill = FieldFill.INSERT)
    @Version
    private Integer rowVersion;
    /**
     * 创建时间
     */
    @TableField(value = "createTime",fill = FieldFill.INSERT)
    private Timestamp createTime;
    /**
     * 更新时间
     */
    @TableField(value = "updateTime",fill = FieldFill.INSERT_UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Timestamp updateTime;
}
